home *** CD-ROM | disk | FTP | other *** search
- @2 Understanding the Interface
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~
- @3Part 4 - EDIT ZONES
- ~~~~~~
- @4
- So far, you should be getting along quite nicely with the
- basics of the interface. You should be able to create simple
- requesters, similar to those that are found within AMOS
- Professional itself. A zone that is used extensively in AMOS
- Pro (and Workbench) is the Edit Zone. In this type of zone,
- you can enter text or numbers and use the cursor keys,
- perfect for database programs where the user wants to fill in
- fields of information.
-
- As always, a pre-written program is supplied named
- 'Interface_Example6.AMOS'. Load this into the editor now and
- run it to give you an idea of what it's all about. 3 new
- commands are introduced in this program, all the others you
- should be familiar with. The first new interface instruction
- is called LIne. This command will draw a line using the
- graphic image from the resource bank that is specified. An
- example of its use follows:
- @1
- A$=A$+"LIne 8,15,17,240;"
- @4
- The first parameter, 8, is the starting X-coordinate of the
- line. The 15 is the starting Y-coordinate. The 17 is the
- image in the resource bank for a line (check if you don't
- believe me!) and the 240 is the width of the line. Easy.
- All that does is draw a line to put the zone in, just to make
- it look pretty, it doesn't actually set up the zone. The
- command to set up the zone is described next.
- @1
- A$=A$+"EDit 1,16,19,26,80,'Change me',0,7;"
- @4
- That last instruction will set up an edit zone with an
- identification number of 1. It will be positioned 16 pixels
- across the screen (X-coordinate), and 19 pixels down the
- screen (Y-coordinate). The maximum amount of characters
- displayed in the zone is 26 although a maximum of 80
- characters is allowed to typed. After these parameters is
- the initial string which will be put into the zone when the
- edit zone is first drawn. It can be left blank if you so
- wish. Next come the paper and pen settings, 0 and 7
- respectively. Setting up an edit zone is all very well and
- good but so far we have no way of getting the string that was
- entered into the edit zone. So a function called Rdialog$ is
- supplied which reads strings from a interface program.
- @4
- Rdialog$ is almost the opposite of Vdialog$ which we
- discussed earlier. The only difference between the two is
- that Vdialog$ deals with variables and Rdialog$ deals with
- zones. Rdialog$ is used as follows:
- @1
- MESSAGE$=Rdialog$(1,1)
- @4
- The two parameters in the Rdialog$ function are the channel
- number and the zone to be read respectively. The string will
- be passed into the MESSAGE$ variable, so now you can display
- the string using an ordinary Print instruction. With these
- new instructions, you can build up an edit requester with
- ease.
-
- Another type of edit zone is provided, called a Digit Zone.
- This just allows the user to enter numbers. However, this
- type of zone is badly bugged and causes software failures, so
- I don't recommend that you actually use it. Also, when
- negative numbers are entered, strange results are returned.
- To see the Digit Zone in action, load the file
- 'Interface_Example7.AMOS' into the editor now. One important
- new instruction in the code is the Rdialog function, which
- like Rdialog$ gets something back from the interface zones.
- @4
-
-
- This version however gets integer values. Study the code for
- the parameters of both new instructions.
-
-
- @5
- Andy will hopefully be back next issue with ven more Interface
- help files and examples for you all.
-
- Why don't you all drop him a line and ask for his help on anything
- to do with the Amos Pro Interface ?
-
- Andy is only too happy to solve your problems via the pages of AZ.
-
-
- His address is elsewhere in this very issue !
-
-
- (Andy Gibson)
-